
<?php
//本地路径滚adminasdfdasfasdf

$local = '/wwwroot/test';
//仓库地址
$remote = 'https://gitee.com/yhtsm/test.git';
 
//密码
$password = '123456';
 
//获取请求参数
$request = file_get_contents('php://input');
if (empty($request)) {
  die('请求参数为空');
}
 
//验证密码是否正确
$data = json_decode($request, true);
if ($data['password'] != $password) {
  die('密码错误');
}
//return;
echo shell_exec("cd {$local} && git pull {$remote} 2>&1");
die('done' . date('Y-m-d H:i:s'));
?>
